package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118650908";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDAct0Nid5gdnREvZfleCgyIz4TxINlRthY0gV7Yj6yD4KrshV7Rp4Ul28WcX0ZgRgiMMb7WBkHm4lqmvqqxWN1VMKA0Vac8qKV1rlDMSPx/b4LukHUEXb1daXPL8qZioXCpD87Rk2MVt3CBgREZXmGVLAreQuCLJOcuXSuJNsdSkTAPPU22J/WVDFtUohcCVeQY0FmdSRCAyIt1HwA2mvrl+BLzH0lnA+7uop2/auET0KADZR0LyDYH9U5wnnUFumnmLo6ry8VyGCQ32Q4CbPsLwVqeprfQary/7HXrYdIHWUBgV37N7gD5AHT7S8qm3r++ku52VIaM+BzthNQBwhdAgMBAAECggEBAJL4pbzrJ3s/u3er208RvpDbvVLXZwl3W04pxqn906eklMSPEjy9J4jORbY8Ia/SmR2zZqMZGrRmokFZ7klwyY4XlxtNw/nEi0onXADmjG8Iu5S1QAS2+cRnfqOF+hHcal7FlMyt2hdtV5oPgj7ByFdAYfIxVQqrBGhScbt0xinM8rYOWWxLU3i0IGmmQ7UZIoRrbl86HAsFQ/zrxSFd/mvRzxGFsW751LDmMgauyqlJxpM/2htpX9jvsCtHvyXSmhcYAjYycNCO9KVZxgPuB8YpPyiLb4whGCc/ZkMdELwx1ZQLhlrcY5Evu74nin2wvGxeZjLfTaXpoXltGHy3mgECgYEA+uLTnuBRhHmhKaWer1yYuuV/zTHG409VQ5k63dH3QKQtuSdteTZzhlJrazcqH1SfsYzKHuY4mSqqzkX/xraAtDle2buQKHW2kG9nvBBphZmiZZZdA187ELsLv/auECHfvgJUk6zo/ZCyfT5++3JhqWYUJ8QnLA0ApsJ3r/NOMJ0CgYEAxF8ZXRN8/aeakLeJOTZJoNfzbcSUlKmhxdAwkXD3SCiXV+5nvImHgvu7xImWy92+PITKP/wpJpMzHw8N0y2JR1rMmyh7YASjvqgepp8w5yxltBrkcAaQf47bapZqhU+og4AGBHMumsp/dCpejrJouL5V8u6j0GbWR+LIl7/zSsECgYAbS3YugMUdnoX0G/qppW9QVguTbWjv7f+evRr0axV1SOdYj3uPhmcHJAxfu76vbet5y5Fpzy41K7kte9wZ6F0UPnGdSpSicjwMdrJYeYihaleKqdMwvLmWVmMu3U2On8DR0TsWXedzPrzMd3IlNQp+/YYP1X1Vg4ygl+OhltzY2QKBgQCmVILwUqyBUfDa+Yry+ee9pI0dge/0SAatvh0VZGEgLrmakmYtzTQKH125KG2hOq6DJlsFfXoBoZcgjKjCIgTweplqJwzxlJx5xn9H1PkgJnvy5QBvXzAPy5pQmx2Y05NB5zOxmzpzhGgWpji3l6iaKyY0AiyhPinsc8xCtSTHQQKBgG0T5XgmdBOfUwqSyNM5ZUUXq8DvsliSPldYi1MnRL/o0VQj5FIb9eVBT1DyoVQSp3Zc/QAt75GMIBDGJwAY7DjfXtFAi1tv4MLOtSMG3gLNoa7Q3iAQAyHbqNiOT64DAJzqHvGJ/po2WqnDE8pv8Vyxc8Y/mgg3ybXc+81WIj7v";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiS/0lwqNkEQLjREXqcD37iSwvS7Yt3ODVOebWcZ1MKmZUawe1eOsAd6F3iBMypbej0yA/7OyyK0AXQ12AXs0lP1NValMqk6ds7iwVvmN00VvZn4nZLC9QtwiRISwZ42xMxk+4Jfc+iC8UTT+nX/18JxzEMrxMDa0wvQdEL3UFFn2L6r8p+NLJWOYZrhjAWqtxTWWCi5UPEtTUpE4MiS4teGZQfmepj53t9TAqxMGck4CQIBq8tX33KUEoHbXdGqqqzSKemb/VPWxCmEgtpzmqyUV6lD88254vNGPquCMuqLpex4yYjn4wizcM35v/1YA7gs4BLifz5HgHveofVOjbQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://4sa5658815.qicp.vip:21972/notfyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://4sa5658815.qicp.vip:21972/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志路径
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

